/*邮件管理*/
layui.define(['layer','form','layedit','element'], function(exports) {
    var $ = layui.jquery;
    var layer=layui.layer;
    var form = layui.form();
    var layedit = layui.layedit;
    var element = layui.element();
    
    layedit.set({
        //编辑器内部上传图片
        uploadImage: {
            url: 'html/worklogs/srv/upd_worklogs_edit_img.php' //接口url
            ,ext: 'jpg|png|gif'
        }
    });
    //构建编辑器
    var index = layedit.build('content');


    $('#btn_save').click(function(){
        layedit.sync(index);
        if($("#type").val()==""){layer.msg("请选择日志类型");return false;}
        if($("#content").val()==""){layer.msg("请填写日志内容");return false;}
        $.post('html/worklogs/srv/edit_worklogs.php',$('#form1').serialize(),function(e){
            layer.msg(e);      
            setTimeout("parent.layer.close(parent.layer.getFrameIndex(window.name))", 2000);
        })
    });  
    exports('worklogs_edit', {});
    
});